package com.qbw.app.model;

import androidx.databinding.Bindable;
import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * @author qinbaowei
 * @date 2018/1/27
 * @email qbaowei@qq.com
 */

public class Version extends BaseModel implements Serializable {
    public static final int FORCE_UPDATE = 1;
    @SerializedName("versionCode")
    private String latestVersion = "";
    @SerializedName("appOsPath")
    private String updateUrl = "";
    private String title = "";
    @SerializedName("versionRemark")
    private String content = "";
    /**
     * 是否强制更新 1是，0否
     */
    @SerializedName("isEnforce")
    private int isUpdate;

    @Bindable
    public String getLatestVersion() {
        return latestVersion;
    }

    public String getUpdateUrl() {
        return updateUrl;
    }

    @Bindable
    public String getTitle() {
        return title;
    }

    @Bindable
    public String getContent() {
        return content;
    }

    @Bindable
    public int getIsUpdate() {
        return isUpdate;
    }

    public boolean hasUpdate() {
        return !TextUtils.isEmpty(updateUrl);
    }

    public void setIsUpdate(int isUpdate) {
        this.isUpdate = isUpdate;
    }

    public static class Response extends BaseResponse<Version> {}
}
